package com.sun.mybatisplus.bean;


import cn.hutool.json.JSONUtil;
import com.sun.mybatisplus.bean.dto.RelevanceDataDTO;
import org.junit.Test;
import org.springframework.beans.BeanUtils;

import java.util.Arrays;
import java.util.List;

public class UserParent {
    public static void main(String[] args) {
        User user = new User();
        user.setAge(20);
        user.setId(21L);
        user.setName("张三");
        user.setEmail("1561321@");
        /*List list = new ArrayList();
        list.add(1);
        list.add(1);
        list.add(1);
        user.setList(list);*/

        /*JSONObject jsonObject = new JSONObject();
        jsonObject.set("user",user);
        String str = JSONUtil.toJsonStr(jsonObject);
        System.out.println(str);*/
        User2 user2 = new User2();
        BeanUtils.copyProperties(user,user2);
        System.out.println(user2);

    }

    private static final Byte RELEVANCE_BEFORE = 1; //报销单已关联事前申请单
    private static final Byte NOT_RELEVANCE_BEFORE = 0; //报销单未关联事前申请单
    private static final List as = Arrays.asList(RELEVANCE_BEFORE,NOT_RELEVANCE_BEFORE);
    @Test
    public void test1(){
        RelevanceDataDTO relevanceDataDTO = new RelevanceDataDTO();

        relevanceDataDTO.setEnableAddMoney((byte) 1);
        String str = JSONUtil.toJsonStr(relevanceDataDTO);
        System.out.println(str);
    }
}
